package com.mobilnaElka.activities;

import android.app.Activity;
import android.content.Intent;
import android.graphics.drawable.AnimationDrawable;
import android.os.Bundle;
import android.view.*;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class IntroAnimationActivity extends Activity {

	AnimationDrawable eitiAnimation;
	Intent intent;

	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.intro);

		ImageView eitiImage = (ImageView) findViewById(R.id.rocket_image);
		
		intent = new Intent(this, MainActivity.class);
		eitiImage.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				finish();
				startActivityForResult(intent, 0);
				
			}
			
		});
		
		eitiImage.setBackgroundResource(R.anim.eiti_anim_logo);
		eitiAnimation = (AnimationDrawable) eitiImage.getBackground();
		
		
	}

	@Override
	public void onWindowFocusChanged(boolean hasFocus) {
		super.onWindowFocusChanged(hasFocus);
		if (hasFocus)
			eitiAnimation.start();
	}
	
	
	

}